﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using System.ComponentModel;

namespace MRSite.Entity
{
    /// <summary>
    /// 店铺
    /// </summary>
    [Table(Name = "shop")]
    public class Shop : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

        /// <summary>
        /// 店铺名称
        /// </summary>
        [Column(Name = "title")]
        public String title { get; set; }

        /// <summary>
        ///类别ID
        /// </summary>
        [Column(Name = "category_id")]
        public int category_id { get; set; }

         /// <summary>
        /// 类型ID （1个人店、2企业店）
        /// </summary>
        [Column(Name = "type_id")]
        public int type_id { get; set; }
        

        /// <summary>
        /// 用户id
        /// </summary>
        [Column(Name = "memberid")]
        public int memberid { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column(Name = "memberusername")]
        public String memberusername { get; set; }

      


           /// <summary>
        ///  账户余额
        /// </summary>
        [Column(Name = "balance")]
        public Decimal balance { get; set; }

        /// <summary>
        ///  总账户余额
        /// </summary>
        [Column(Name = "totalfee")]
        public Decimal totalfee { get; set; }
        
         /// <summary>
        ///  冻结金额
        /// </summary>
        [Column(Name = "freezeamount")]
        public Decimal freezeamount { get; set; }
        

        /// <summary>
        /// 联系人姓名
        /// </summary>
        [Column(Name = "realname")]
        public String realname { get; set; }

        /// <summary>
        ///  联系电话
        /// </summary>
        [Column(Name = "mob")]
        public String mob { get; set; }

         /// <summary>
        ///  微信 
        /// </summary>
        [Column(Name = "weixin")]
        public String weixin { get; set; }
        

        /// <summary>
        /// 省
        /// </summary>
        [Column(Name = "province")]
        public String province { get; set; }

        /// <summary>
        /// 区域 市
        /// </summary>
        [Column(Name = "city")]
        public String city { get; set; }

        /// <summary>
        /// 区
        /// </summary>
        [Column(Name = "area")]
        public String area { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "addtime",IsDbGenerated=true)]
        public DateTime addtime { get; set; }

        /// <summary>
        /// 确认时间
        /// </summary>
        [Column(Name = "checktime")]
        public DateTime? checktime { get; set; }

        /// <summary>
        ///0,审核中，1可用，2禁用，3：重新提交
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }

        /// <summary>
        /// 店铺等级
        /// </summary>
        [Column(Name = "levels")]
        public int levels { get; set; }

        /// <summary>
        /// 排序，越大越靠前
        /// </summary>
        [Column(Name = "sort")]
        public int sort { get; set; }

        /// <summary>
        ///  地址 
        /// </summary>
        [Column(Name = "address")]
        public String address { get; set; }

        /// <summary>
        ///  logo 
        /// </summary>
        [Column(Name = "logo")]
        public String logo { get; set; }

        /// <summary>
        ///  背景图片 
        /// </summary>
        [Column(Name = "bg")]
        public String bg { get; set; }

        /// <summary>
        /// 店铺封面 店铺广告背景 
        /// </summary>
        [Column(Name = "advbg")]
        public String advbg { get; set; }


        /// <summary>
        /// 客服微信二维码 收款二维码 
        /// </summary>
        [Column(Name = "skmpay")]
        public String skmpay { get; set; }

        /// <summary>
        ///  微信收款二维码 
        /// </summary>
        [Column(Name = "weixin_skm")]
        public String weixin_skm { get; set; }

        /// <summary>
        ///  支付宝收款二维码
        /// </summary>
        [Column(Name = "alipay_skm")]
        public String alipay_skm { get; set; }

        /// <summary>
        /// 银行名
        /// </summary>
        [Column(Name = "bankname")]
        public String bankname { get; set; }

        /// <summary>
        /// 银行帐号
        /// </summary>
        [Column(Name = "bankaccount")]
        public String bankaccount { get; set; }

        /// <summary>
        /// 开户名
        /// </summary>
        [Column(Name = "account")]
        public String account { get; set; }

        /// <summary>
        /// 银行支行
        /// </summary>
        [Column(Name = "zhihang")]
        public String zhihang { get; set; } 

          /// <summary>
        /// 身份证号码
        /// </summary>
        [Column(Name = "idcard")]
        public String idcard { get; set; } 
        
          /// <summary>
        /// 认证类别 1个人认证 2商家认证
        /// </summary>
        [Column(Name = "rztype")]
        public int rztype { get; set; } 

          /// <summary>
        /// 身份证下面照片
        /// </summary>
        [Column(Name = "cardUp")]
        public String cardUp { get; set; } 

          /// <summary>
        /// 身份证反面照片
        /// </summary>
        [Column(Name = "cardDown")]
        public String cardDown { get; set; }

        /// <summary>
        /// 手持身份证照片
        /// </summary>
        [Column(Name = "cardHand")]
        public String cardHand { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [Column(Name = "companyname")]
        public String companyname { get; set; } 

        /// <summary>
        /// 营业执照
        /// </summary>
        [Column(Name = "blicense")]
        public String blicense { get; set; } 

          /// <summary>
        /// 几颗星
        /// </summary>
        [Column(Name = "xing")]
        public decimal xing { get; set; }


        /// <summary>
        /// 开始时间
        /// </summary>
        [Column(Name = "starttime")]
        public DateTime? starttime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [Column(Name = "endtime")]
        public DateTime? endtime { get; set; }

        /// <summary>
        /// 推荐人用户id
        /// </summary>
        [Column(Name = "puserid")]
        public int puserid { get; set; }

        /// <summary>
        /// 推荐人用户名
        /// </summary>
        [Column(Name = "pusername")]
        public String pusername { get; set; }

        /// <summary>
        /// 申请人用户id
        /// </summary>
        [Column(Name = "apply_userid")]
        public int apply_userid { get; set; }

        /// <summary>
        /// 申请人用户名
        /// </summary>
        [Column(Name = "apply_username")]
        public String apply_username { get; set; }


        private EntityRef<ShopCategory> _ShopCategory;
        /// <summary>
        /// 商品类别,外键
        /// </summary>
        [Association(Storage = "_ShopCategory", ThisKey = "category_id", OtherKey = "id")]
        public ShopCategory ShopCategoryItem
        {
            get { return this._ShopCategory.Entity; }
            set { this._ShopCategory.Entity = value; }
        }

    }
}
